package com.wwz.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Id;
import java.io.Serializable;
import java.util.Date;

@Data
@NoArgsConstructor
@TableName("pe_permission")
@ApiModel("权限")
public class Permission implements Serializable {

    private static final long serialVersionUID = -4990810027542971546L;

    @Id
    @ApiModelProperty("主键")
    private String id;

    @ApiModelProperty("权限名称")
    private String name;

    @ApiModelProperty("权限类型 1为菜单 2为功能 3为API")
    private Integer type;

    @ApiModelProperty("权限编码")
    private String code;

    @ApiModelProperty("权限描述")
    private String description;

    @ApiModelProperty("父id")
    private String pid;

    @ApiModelProperty("可见状态")
    private String enVisible;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty("创建时间")
    private Date createTime;

    public Permission(String name, Integer type, String code, String description) {
        this.name = name;
        this.type = type;
        this.code = code;
        this.description = description;
    }

}